package com.base.vo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;

import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * 相同或相似患者权重判定设置
 * @TableName empi_weight_config
 */
@TableName(value ="empi_weight_config")
@Data
public class EmpiWeightConfig implements Serializable {
    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    /**
     * 数据源ID
     */
    private String datasourceId;

    /**
     * 相同数据判定权重
     */
    private Integer sameWeight;

    /**
     * 相似患者判定权重
     */
    private Integer seemWeight;

    /**
     * 创建时间
     */
    private Date createDate;

    /**
     * 更新时间
     */
    private Date updateDate;

    /**
     *
     */
    private String ruleName;

    /**
     * 匹配类型
     */
    private Integer ruleType;

    /**
     *
     */
    private String ruleTypeName;

    /**
     * 是否启用
     */
    private Integer isUse;

    /**
     * 排序号
     */
    private Integer orderby;

    /**
     * 包含字段列表
     */
    @TableField(exist = false)
    private List<EmpiAlgorithmConfig> algorithmConfigList;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        EmpiWeightConfig other = (EmpiWeightConfig) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getDatasourceId() == null ? other.getDatasourceId() == null : this.getDatasourceId().equals(other.getDatasourceId()))
            && (this.getSameWeight() == null ? other.getSameWeight() == null : this.getSameWeight().equals(other.getSameWeight()))
            && (this.getSeemWeight() == null ? other.getSeemWeight() == null : this.getSeemWeight().equals(other.getSeemWeight()))
            && (this.getCreateDate() == null ? other.getCreateDate() == null : this.getCreateDate().equals(other.getCreateDate()))
            && (this.getUpdateDate() == null ? other.getUpdateDate() == null : this.getUpdateDate().equals(other.getUpdateDate()))
            && (this.getRuleName() == null ? other.getRuleName() == null : this.getRuleName().equals(other.getRuleName()))
            && (this.getRuleType() == null ? other.getRuleType() == null : this.getRuleType().equals(other.getRuleType()))
            && (this.getRuleTypeName() == null ? other.getRuleTypeName() == null : this.getRuleTypeName().equals(other.getRuleTypeName()))
            && (this.getIsUse() == null ? other.getIsUse() == null : this.getIsUse().equals(other.getIsUse()))
            && (this.getOrderby() == null ? other.getOrderby() == null : this.getOrderby().equals(other.getOrderby()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getDatasourceId() == null) ? 0 : getDatasourceId().hashCode());
        result = prime * result + ((getSameWeight() == null) ? 0 : getSameWeight().hashCode());
        result = prime * result + ((getSeemWeight() == null) ? 0 : getSeemWeight().hashCode());
        result = prime * result + ((getCreateDate() == null) ? 0 : getCreateDate().hashCode());
        result = prime * result + ((getUpdateDate() == null) ? 0 : getUpdateDate().hashCode());
        result = prime * result + ((getRuleName() == null) ? 0 : getRuleName().hashCode());
        result = prime * result + ((getRuleType() == null) ? 0 : getRuleType().hashCode());
        result = prime * result + ((getRuleTypeName() == null) ? 0 : getRuleTypeName().hashCode());
        result = prime * result + ((getIsUse() == null) ? 0 : getIsUse().hashCode());
        result = prime * result + ((getOrderby() == null) ? 0 : getOrderby().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", datasourceId=").append(datasourceId);
        sb.append(", sameWeight=").append(sameWeight);
        sb.append(", seemWeight=").append(seemWeight);
        sb.append(", createDate=").append(createDate);
        sb.append(", updateDate=").append(updateDate);
        sb.append(", ruleName=").append(ruleName);
        sb.append(", ruleType=").append(ruleType);
        sb.append(", ruleTypeName=").append(ruleTypeName);
        sb.append(", isUse=").append(isUse);
        sb.append(", orderby=").append(orderby);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}
